import request from "@/sheep/request";

const ConserveApi = {
	// 获得用户的植物位置、品种列表
	getConserveList: (uid:number) => {
	  return request({
	    url: '/huadada/conserves/list',
	    method: 'GET',
		params: {uid}
	  });
	},
	
	//添加共同养护人
	addConserve: (data) =>{
		return request({
			url: '/huadada/conserves/create',
			method: 'POST',
			data,
			custom: {
			  showSuccess: true,
			  successMsg: '保存成功'
			},
		})
	},
	//更新共同养护人审核状态
	updateConserve: (data) =>{
		console.log('addLocationBreed - data', data)
		return request({
			url: '/huadada/conserves/update',
			method: 'PUT',
			data,
			custom: {
			  showSuccess: true,
			  successMsg: '保存成功'
			},
		})
	},
	// 获得共同养护人信息（所属用户）
	getConserve: (id:number) => {
	  return request({
	    url: '/huadada/conserves/get',
	    method: 'GET',
	    params: { id }
	  });
	},
	//删除共同养护人
	deleteConserve:(id:number) => {
	  return request({
	    url: '/huadada/conserves/delete',
	    method: 'DELETE',
	    params: { id }
	  });
	}
}

export default ConserveApi;